/*
冒泡排序
*/
package main

import (
	"fmt"
)

func main() {
	a := [...]int{4, 1, 5, 8, 9}
	var lenOfA = len(a)
	for i := 0; i < lenOfA; i++ {
		fmt.Println(a[i])
		fmt.Println("\n")
		for j := i + 1; j < lenOfA; j++ {
			fmt.Println(a[j])
			fmt.Println(a[i])
			if a[j] > a[i] {
				var tmp = a[i]
				a[i] = a[j]
				a[j] = tmp
			}
		}
		break
	}
	fmt.Println(a)
}
